<?php 
use_javascript('/charts/charting/js/excanvas.js');
use_javascript('/charts/charting/js/visualize.jQuery.js');
use_stylesheet('/charts/charting/css/visualize.css');
use_stylesheet('/charts/charting/css/visualize-dark.css');

?>
<table style="height:30px;padding:10px;">
<tr>
	<th style="width:1%;">Chart Type</th>
	<td><select onchange="drawChat( $(this).val() );">
		<option value="pie">Pie chart</option>
		<option value="bar">Bar chart</option>
	</select></td>
</tr>
</table>
<script>
$(function(){
 	drawChat('pie');
	/*$('table').visualize({type: 'bar', width: '420px'});
	$('table').visualize({type: 'area', width: '420px'});
	$('table').visualize({type: 'line', width: '420px'});*/
});
var chart = null;
function drawChat(type){
	if(chart == null){
		chart = $('#report_table_data').hide().visualize({type: type, height: '300px', width: '420px'}).css('margin-top',0);
		return;
	}
		chart.hide();
		chart = $('#report_table_data').hide().visualize({type: type, height: '300px', width: '420px'}).css('margin-top',0);	
	
	
}

</script>